#include<iostream>
#include<vector>
#include<string.h>
using namespace std;

namespace v
{
	template<class t>
	class vector
	{
	public:
		typedef t* iterator;
		vector(size_t i, iterator& j = '\0')
			:_start(nullptr)
			, _finsh(nullptr)
			, _end(nullptr)
		{
		}
		~vector()
		{
			delete[] _start;
			_start = _finsh = _end = nullptr;
		}
		void push_back(iterator d1)
		{
			if (capacity() == size())
			{
				size_t capacity = capacity() == 0 ? 4 : capacity * 2;
				iterator tmp = new t(capacity);
				if (_start)
				{
					memcpy(tmp, _start, sizeof(t)*capacity);
					delete[] _start;
				}
				_start = tmp;
				_finsh = _start + size();
				_end = _start + capacity();
			}
			*_finsh = d1;
			++_finsh;
		}
		iterator capacity()
		{
				return _end - _start;
		}
		iterator size()
		{
				return _finsh - _start;
		}
		iterator operator[](int i)
		{
				return _start[i];
		}
		private:
			iterator _start;
			iterator _finsh;
			iterator _end;
	};
	int main()
	{
		return 0;
	}
}